package com.sys.demo.service;

import com.sys.demo.model.UserModel;
import com.sys.demo.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author wr
 * @Description //TODO $
 * @Date $ $
 * @Param $
 * @return $
 **/
@Service
public class UserService {

    @Autowired
    private UserRepository userRepository;

    public UserModel get(Long id){
       return userRepository.getById(id);
    }

    public UserModel add(UserModel user){
        return userRepository.save(user);
    }
}
